﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TaggingToolkit.Framework
{
    public class InterrogationState
    {
        public ConcurrentQueue<DataTags> Queue { get; set; } = new ConcurrentQueue<DataTags>();
        public object locker { get; } = new object();
        public int Total { get; set; } = 0;
        public bool Busy { get; set; } = false;
        public bool IsEmpty { get => Queue.IsEmpty; }

        public void Enqueue(List<DataTags> enqueue)
        {
            for (int i = 0; i < enqueue.Count; i++)
            {
                enqueue[i].ScheduledForInterrogation = true;
                Queue.Enqueue(enqueue[i]);
            }

            Total += enqueue.Count;
        }

        public bool TryDequeue(out DataTags item)
        {
            return Queue.TryDequeue(out item);
        }
    }
}
